home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1995 October / EnigmA AMIGA RUN 01 (1995)(G.R. Edizioni)(IT)[!][issue 1995-10][Aminet 7].iso / Aminet / misc / emu / prlink_amiga.lha / prlink-0.8.0a / src / basic-listing next >
Text File  |  1995-04-03  |  2KB  |  78 lines

  1. A bootstrap program for the PET and the 4/8 bit version of the prlink
  2. cable.
  3.  
  4. Versions for VIC, 64 and 128 can easily be made by changing lines 100-130.
  5. Also remove line 200 for 64 and 128.
  6.  
  7. VIC-20:
  8.  99 hs=20
  9.  100 av=32:ack=37148: rem ack (out) is cb2
  10.  110 dat=37136: rem port b
  11.  120 ddr=37138
  12.  130 sv=16:srobe=37149: rem strobe (in) is cb1
  13.  
  14. C64 and C128:
  15.  99 hs=64:rem or 128
  16.  100 av=4:ack=56576: rem ack (out) is pa2 
  17.  110 dat=56577: rem port b
  18.  120 ddr=56579
  19.  130 sv=16:srobe=56589: rem strobe (in) is -flag
  20.  200
  21.  
  22. Patches for the pc64 cable:
  23.  300 poke ddr,15:gosub1000
  24.  1030 poke ack,peek(ack) and (255-av)
  25.  1040 if (peek(sr) and sv) = 0 then 1000
  26.  1050 poke sr,sv
  27.  1060 by = peek(dat) and 240 or (by/16)
  28.  1070 poke ack,peek(ack) or av
  29.  1080 return
  30.  1230 poke ack,peek(ack) and (255-av)
  31.  1270 poke ack,peek(ack) or av
  32.  1300 return
  33.  
  34. PET (4/8-bit prlink cable):
  35.  99 hs=201:rem system type
  36.  100 av=32:ack=59468: rem ack (out) is cb2
  37.  110 dat=59471: rem port a
  38.  120 ddr=59459
  39.  130 sv=2:srobe=59469: rem strobe (in) is ca1
  40.  199 rem *** init cb2 and ca1
  41.  200 poke ack, (peek(ack) and 254) or (128+64+32)
  42.  300 poke ddr,0:gosub 1000
  43.  310 printby
  44.  320 if by then 330
  45.  322 by=hs:gosub 1200
  46.  324 by=0:gosub 1200:gosub 1200:gosub 1200:gosub 1200
  47.  326 goto 300
  48.  330 if by=1 then gosub2000:goto300
  49.  340 print"(unknown function)":goto 300
  50.  999 rem *** receive a byte
  51.  1000 if (peek(sr) and sv) = 0 then 1000
  52.  1010 poke sr,sv
  53.  1020 by = peek(dat)
  54.  1030 i= peek(ack): i = (i or av) - (i and av) : poke ack,i
  55.  1040 return
  56.  1199 rem *** send a byte
  57.  1200 if (peek(sr) and sv) = 0 then 1200
  58.  1210 poke sr,sv
  59.  1220 poke ddr,15:poke dat,by
  60.  1230 i= peek(ack): i = (i or av) - (i and av) : poke ack,i
  61.  1240 if (peek(sr) and sv) = 0 then 1240
  62.  1250 poke sr,sv
  63.  1260 poke dat,by/16
  64.  1270 i= peek(ack): i = (i or av) - (i and av) : poke ack,i
  65.  1280 return
  66.  1300 poke ddr,0: return: rem *** back to inputs
  67.  1999 rem *** load
  68.  2000 gosub1000:print"bank"by
  69.  2010 by=0:gosub1200
  70.  2020 gosub1000:f=by:gosub1000:f=f+256*by:print"from"f
  71.  2030 gosub1000:t=by:gosub1000:t=t+256*by:print"to  "t
  72.  2040 for a=f to t-1
  73.  2050 gosub1000:printa,by
  74.  2060 next
  75.  2070 return
  76.  
  77. To really do the load function, change the print in line 2050 to poke.
  78.